Added ability to set flags