Added a redirect function.