Fix bug: trigger's error handling