made connecting to server async