modified main-controller