history-dialog now closes when you press escape key
refactoring
refactoring