exception fixed on connect method