fixed deadlocking