Safe and accurate medication dispensing