diff --git a/ippisite/ippidb/templates/compound_list.html b/ippisite/ippidb/templates/compound_list.html
index 240846b04ff2d2572dc82e718dc7d1548514cd29..2e3ca43c08101057c2b5de4457481cf2a9defca0 100644
--- a/ippisite/ippidb/templates/compound_list.html
+++ b/ippisite/ippidb/templates/compound_list.html
@@ -30,7 +30,7 @@
             <span class="border border-primary rounded p-1 m-1">
                 <div class="dropdown btn-group" style="display: inline-flex;">
                     <i class="icon icon-common icon-search mr-1 " style="font-size: 1.75rem; vertical-align: middle" title="Text search"></i>                                
-                    <input id="q" value="{{ q }}" class="form-control" type="text" placeholder="Type search text here" onchange="modifyUrl('q',$('#q').val());">
+                    <input id="q" value="{{ q | default_if_none:"" }}" class="form-control" type="text" placeholder="Type search text here" onchange="modifyUrl('q',$('#q').val());">
                 </div>            
             </span>
             <span class="border border-primary rounded p-1 m-1">