add geolocation function