fix table allocation
update but not sure if it works everywhere....