Changed triggers and functions execution order, since triggers need som func ...