improved check for folder paths.