added testing for records and minor fix to getting records