Fixed error in undo plugin