Revert "Check for IndexError"

The way to fix the problem is not `b not in buttons`, it should be `b < 0 or len(buttons) <= b` instead.