implemented trigger and on