Improve button refreshing behavior