add callback logic