added utils and check for directory