updated geolocation function