main controller fixes