Fixed bug where only initially displayed buttons worked