astar, fix for ap_calc