check also for directories