fix main bug