fix bug about connect