bug in location helper method