fix average calculating of dosage