wait for the connection