Changed redirection function and template