updated main controller