fixed error with an exit out of array