opts is undefined here