changes to trigger.cpp