check for a race condition in onopen