fix main_template