add button index to button callback