fixed indexing problem
merge fix