Fixed small bug with checking location