fix bug deadlock