Fix buttons handling