adjust code to adapt the table change