rename connect function to conn_fn