Check to see if we've reached the end of the map before attempting to