redirect url generation fix