Fix history was not updated correctly on new action
Add tests