fixed bug in slot assignment