do dir check instead of file check