implemented history search