eliminate race condition in selectFrameToSend