Added check to prevent redirecting to non-domain URL