added support for trigger and more tests