added closing connection in case of failed registration or null published buffers
null published buffers do not cause closing connection