fix error with deletion