modify redirect functionality