fixed pathfind bug