runs opts.then after calling the function