diff --git a/web/pgadmin/misc/themes/__init__.py b/web/pgadmin/misc/themes/__init__.py
index 8ebe86c39..4f896cf82 100644
--- a/web/pgadmin/misc/themes/__init__.py
+++ b/web/pgadmin/misc/themes/__init__.py
@@ -33,6 +33,7 @@ def themes(app):
         def get_theme_css():
             all_themes = get_all_themes()
             theme_css = all_themes['standard']['cssfile'] + '.css'
+            theme = 'standard'
             try:
                 misc_preference = Preferences.module('misc')
                 theme = misc_preference.preference('theme').get()
