Fixed issue with not working changing of state.