fix checking for path