fixed usage of wrong iterator in append