added support for trainer message handling