test redirect via function