fix a typo in connect, add error test case