first logic to show dialog output