serialization stackoverflow fix

This change is so that the categories dont all get a pointer to the same model.