Added new redirect function