Fixed input error and changed how the dbi gets records.