added count() and min() for dbi