modified cache control logic