changed sql statement for getLocations