handle null undefined
define clear and clearAll