create directories correctly