fixed deadlock error