changed the way to wait for connection to HWR