bug fix for serialization