Register/Undo loop