replace the template redirect with a Output buffer to be more flexible and handle themes with template functions