Fixed dead lock imported in last patch
Merge pull request #530 from soarqin/official

Fixed dead lock imported in last patch