fixed deadlock with stats