fix bug in update_num_records and rename