added redirect_chain method