fix ref count bug in unserializer