subscribes before calling onopen