fixed more indexing issues