fixed some serialization function related problems