Adding flag parameter. It can help to avoid unnecessary worker function hash table lookups.