Adding async thread for connection to avoid pause in main gui