fixed DELETE function