added support for long messages