added exception handle when a possible close session line 106