handle deleted and non-existing trials better.