Moved state change to take effect directly