avoid divide-by-zero panic