improve user location ajax function