some changes

fixed the bug that sometimes stopped paths from being found