test for toJSON fix