added DoWhenConnected