changed the way to get location