add search function and custom templates