dialog box closed after selecting option