add flag functions to task