Error fixed when calling the function do_connect