fixed an deadlock