Adapt the function return type of callback.