fixed bug in run_loo and run_trainer