fix 0 indexing