update connect and fix error handling