Added error dialog function
Added error handling for no location
Added error handling for no location