check for attributes being defined on model before serializing