ENYO-1336: fix the scope of a variable