added get location function