fix some bugs when tigger error happen