fixed possible concurrency issues in counting correct predictions