prevent concurrent modification of buttons list while iterating over it