emit count-changed event after resetting queue, not before