implement terminate for shinyapps apps