adding code to run as a single page app SPA