Added helper function to help set task as complete or not