avoid signed/unsigned comparison