added some logic to try harder to avoid races on slow machines