fixed undefined error occuring on the initial delete of new items