- Using set on the shallow copy of the state object caused reducer called twice; reducer function should be pure; use deep copy of the state instead of shallow copy