alter addRd function to convert to object so you can use JSON.stringify