Solves issue of undo/redo appears multiple time

Solves issue #146