Adds a mark_dirty function to task