test callback function for async write