fix bug to make the extension work

return {redirect} in Array.ForEach loop does not work