delete seems to affect the original array