When autoassign command is called with an index that is not in the list the program crashes. 