undo disabled button when empty stack, stack cleaned after saving, proper cursor position