Fix a bug in the redirect trapp