fix a bug with clear history