opts.message can be a function