Add a function to call the callback function safely and easily.