fixing bug introduced by makedirs