added sql query to get reachable stops