fix warning caused by comparing size with an int.