Fix the redefinition of the data variable and use a = a.concat(b) instead of a.concat(b).