created getLocation method