adding logic back into table on index