add callback to log to the ui if desired