added support for user-defined flags