change connect async to sync