added the connetion detector