new checking for directory