add validtion of connection