wrapping it on a function with callback