bugfix: index by i