update loading and fix undo