Comparator not working