mixed bug introduced by domain switch function