Fixing a bug in base_list_record which was over-querying the database