change redirect url logic