Fixed the clear function