Fix bug in auto trigger