working astar for endnode not in edge