The fail handler would be unnecessary if you drop the last argument from createHubConnection.