fix saving a trigger in database
Merge logging fix