insert a cast to silence warning about signed/unsigned comparison