Added error handling to geolocation retrieval