Change the size_t cast to int cast