fixed an serializing issue for objects from inherited models.