fixed trial count divide by zero error