fixes control logic