call clear function when action is clicked and update to todo list