Comparision logic fix