update location logic