Every time we enter the dialog the event listeners in this function are added once. Please initialize the UI references and event handlers only once (you may want to use a flag for it).