fix on switching tabs