fix main tag handling