prevent close unsaved text
fix #3