added redirect functionality