bugfix: should not modify content of list in loop body