Add logic for checking flags collection.