error handling in message handling