Don't close the dialog twice, only close it after selection is complete.