Fixed incorrect comparison check