make stats() work again without xdb