fix bug in delete