Fixed the problem with serialize data length