some cleanup and refreshing data after switching tabs