Fixed redo bug