made the backtesting logic a little more robust to null values in DB