fixed a bug with trying to get location information by a wrong way