fixed DB to avoid NaNs