Fixed bug deadlock.