handling trivial case of astar search