added scala case class serialization