Added support for flagged tasks