creatig required dir rather than assuming its existence