updated example to have proper serialization of models