Changed order of directory creation