replace synchronous connect with asynchronous one