call onopen only once