fix comparison between signed and unsigned integer error