add location funcition