wrap a function's last arguments when is a callback function