pattern invocation number now stored separately for every activity