fix comparision to return proper value