def triggers() debug - added a sendmsg function