bug fix in delete