[FIX] Minor fix in the logic and the event used. See #407