fix bug with getting location