clean up connect code
even better error handling
spec green