fixed connect error issue + modified some testcases