Improved shinyGUI closing code