Added finishGPS function