Added support for custom message types