fix custom scope comparision logic