fixed bug in serialization