updated to use index instead of get