added logging of connection status