detect race conditions better