write flags