key indexing issue fix