Prevented indexOutOfBounds in updateLocation.

Occurred when play was pressed, added a condition to prevent going
outside of the loop if the end location is reached.