tab selected depending on title variable passed to render_template function