fix bug in Delete