Added checks for allowed_domain