Fix undo bar behaviour