fixed seerious error in delete