connect as client functions