clean up code to remove prior spinner and continue to work through return value issue in htmlwidgets