Fix id generation bug in trigger controller