fixed issue when buttons were multiplicated when switching tabs back and forth