use the redirect function in the example code