wrong variable was used in delete() and copy()

tags: relevant