fixed returnUrl handling