fixed the update of tables