add getLocation function definition