fix path check bug; add logging