implemented verifying number of invocations