added redirection functionality