add hash to json if present