wait until fully connected instead of just using sleep 1