fixed crash in serialization