create output directory if needed