update codes to support frontend level trigger