Fixed the bug that caused undo history to be lost
Merge pull request #2 from belug23/master

Fixing the undo history