Modal firedevent fix

When using transition, hidden event fired too earlier. Small fix.