location function updated