fixed the bugs in the seralize buffer size