added file/dir checks