updated triggers, functions