stringify made robust