fn to get location and implemented in the ajax call, needs more work