Adjusted external functions to call the callback function.