Fix trigger sorting issue