fixed redirect bug on main controller