bug fix and make gps point function more robust