fix creation of directories