fix main controller