fixed nullpointer bug due to GPS unavailability