buttons work even after switching tabs