fixed misplaced assertion in delete