added better history searching