Reduce the number of calls to the GPS and check for valid variables