Closes Option Dialog after selection and fixes bug that in Firefox the option name is not replaced in the UI