fix some deletion issues