EAGLESIX-3144 fix toJSON bug