add connection function