undo code cleanup, caused bug