fix in pathfind.cpp