diff --git a/api/endpoints/get_sponsored.py b/api/endpoints/get_sponsored.py
index b1efaf7..5035cf3 100644
--- a/api/endpoints/get_sponsored.py
+++ b/api/endpoints/get_sponsored.py
@@ -33,6 +33,14 @@ def write_to_csv(legislation_data, csv_file):
         flattened_legislation.append(flattened_item)
 
     df = pd.DataFrame(flattened_legislation)
+
+    # Debugging: Print the first few entries of the DataFrame to inspect its structure
+    print("Debugging DataFrame:")
+    if not df.empty:
+        print(df.head())
+    else:
+        print("DataFrame is empty.")
+
     if df.empty:
         neo4j_logger.warning(f"No data to write to CSV file: {csv_file}")
         print("DataFrame is empty. Debugging information:")
@@ -40,10 +48,6 @@ def write_to_csv(legislation_data, csv_file):
             print(json.dumps(item, indent=4))
         return
 
-    # Debugging statement to check DataFrame contents
-    print("DataFrame contents:")
-    print(df.head())
-
     df.to_csv(csv_file, index=False)
     neo4j_logger.info(f"Data written to CSV file: {csv_file}")