fix bug: dead lock