Fix the bug where duplicated moves were still added to the history