modify astar by adding reset