add redirect function
implement to() for redirect