avoid divide-by-zero