add generic connection method