Lua how to get the index of a nested table