fix bug with creating two connections when send is called before estabilishing connection