fixed connectedLocations function and added more filters