added first stab at reconnection logic