Make Connect and Disconnect events happen on correct thread