bugfix: invalid index