Modified on location update function