move connect string into function