Check the channel state instead of relying on the onopen event