geolocation function modified