Fixed invalid state on modes change