add callback to opts