fixes for connect_wait