informative assert in buttonIndex function