toJSON test wrong