Support custom callback function.