Improve control on which button was pressed