Revert "Revert "flags update""

This reverts commit 0628364a263f9d239e4d9ee1be7e0ae0bfe47584.