fixed all the table bugs