updated getS3 to use the key output by list