diff --git a/dialog.module b/dialog.module
index bfa8b59..862648d 100644
--- a/dialog.module
+++ b/dialog.module
@@ -64,7 +64,8 @@ function dialog_add_js() {
   // Get the correct CSS path based on jQuery UI version.
   $version_16 = version_compare(jquery_ui_get_version(), '1.7.0', '<');
   $css_path = $version_16 ? 'default' : 'base';
-  drupal_add_css(JQUERY_UI_PATH .'/themes/'. $css_path .'/ui.all.css');
+  $jquery_path = jquery_ui_get_path();
+  drupal_add_css($jquery_path .'/themes/'. $css_path .'/ui.all.css');
 
   // And finally, the dialog js.
   drupal_add_js(drupal_get_path('module', 'dialog') .'/dialog.js');
