added some error handling for geolocation