fix the serialization issue for case class