added 301 status to the setRedirect method