fix issue where reusing a passed-by-ref variable was looping the same id twice
fix issue where reusing a passed-by-ref variable was looping the same id twice

rcdelfin/mautic,rcdelfin/mautic,rcdelfin/mautic