Added saving triggers.
Added logic for firing event for triggers.