Geolocation function fixed