fixed bug in doctotals script