add server deadlock detecting
fix the bug for the first connecting to BT