bugfix with table_prefix not being global