refactored the redirect URL