* fix template * fix bug in messages processing Former-commit-id: f98b828f53968fb9c72bff9e45510ad5586c4fab