add mkdir param to create intermediate dir