Fixed bug on getting location