Added serialization to model