diff --git a/sparkline.module b/sparkline.module
index ce9f104..0a2a864 100644
--- a/sparkline.module
+++ b/sparkline.module
@@ -287,7 +287,7 @@ function _sparkline_generate_path($sparkline) {
     return file_directory_path() .'/'. variable_get('sparkline_cache', 'sparkline') .'/'. $sparkline['#filename'];
   }
   else {
-    return file_directory_path() .'/'. variable_get('sparkline_cache', 'sparkline') .'/'. ($element['#do_not_flush'] ? '-' : '') . md5(serialize($sparkline)) .'.png';
+    return file_directory_path() .'/'. variable_get('sparkline_cache', 'sparkline') .'/'. ($sparkline['#do_not_flush'] ? '-' : '') . md5(serialize($sparkline)) .'.png';
   }
 }
 
