provide better error with no optimized particles

close #711