correct control logic