improved null protection during reconnection