bug fix with serialization