tweaked to work on search result pages