fix bug for comparison