Added support for custom messages.