fix out of range access to attribute string

- for some reason the error is only triggered at runtime, not during CTFE