Fixed the bug with undoing everything