use size_t instead of long