fix list comparing code