change to template_redirect for register page --KW