check for connection function