fixed the bug not to connect the server.