bugfix indexing error