fix table conversion and updating index