fix signed unsigned comparison error