fixed a connection bug