Make Connect() function return error