fixing the leaked dialog.show() on empty dataset for the chart