Fix getLocation JS problem