add disdinguish between files and directory