fixes on _tables functions