updated script for triggers