mutating an array while iterating over it fix #142