attempt to fix table reference counting issues