fixing some bugs

fix a bug in clear