added mkdir for output