added support for flags