fix waitlist onInvalidate callback to use afterFlush