modify client connect logic