added a test method to redirect users with code