fix comparison between signed and unsigned