Destroy instances before destroying the container