fixed closure of resource in csv reporter