added spinner and logout functionality