add control logic