add optional argument to getHref function
use getHref function, fix search, fix clear search