added clear function upon submit