Fix buttons problems on closing tabs