switched out .toJSON() for .attributes

the proper way to do this