clear function now works