made changes to support fetching of multiple records.