search template mostly working