fix trigger message env and replace problem