fixing database readout in case of small data counts