fixing issue that caused performance issues generating measure logic