move validation to main testing loop - ensures cleanup on failure