fixed history bar, added clear history option

fixed clear variable being undefined