fixing comparison count for rails