Added updateLocation function