add location function