add duplicate environment check