trial generation bugfix