Fix ouput file name bug for seg