added support for last message in rules