Fix jsonSerialize method