Add error handling to MessageBroker.cs