foreach on json.target instead of using the array itself