fix an exception when table id nil