change error event to failed

.connect() callback handler looks for `failed` event. But we fire `error` event. 
This is the fix.