fix main refine