Removed calling dialog.hide() function.