fix button index issue