function for removing all completed tasks