add function and callback