Popup not coming second time due to Uncaught TypeError: Cannot read property 'style' of null

Hi ,

I select multiple rows from table which have same country and assign ‘gold’ from Medal column for the selected rows. Then a popup comes up to allow me put ranking for the selected rows.

After putting ranking for one set of country, if I try to put ranking for another set of country, the popup does not come up. It gives below error in console as:

Uncaught TypeError: Cannot read property ‘style’ of null
Snippet : https://snippet.webix.com/yigsmrb9

How can I get rid of this error ?
Can anybody please help soon.

Much Thanks

popup.close() destructs popup.
use hide() instead
$$("mpop").hide();