Added missing state flag value change