added his flag setting function