Set key by index instead