Fixing bug missing output directory