Added control logic.