added support for before triggers