I did end up finding a solution- by changing where I placed the “es” object.
Please see attached screenshot for the new code snippet that worked: