use makedirs, not mkdir