simplify path check