removed deprecated table.getn call