update clear function