fix check of whether location has been initialized