Added possibility to replace matching messages