fix for comparison between signed and unsigned