updated export_system_tables code