make more robust to non-finiteness