Fixed bug in trigger

apply was getting called on an undefined object causing callbacks to fail