add redirect url handling