output directory handling