fix for buffer overflow in db results