new redirect function and response class