#422 - fixed close after saving modified document