successfully generate callback function