diff --git a/cps/templates/layout.html b/cps/templates/layout.html
index d486e103..349feca9 100644
--- a/cps/templates/layout.html
+++ b/cps/templates/layout.html
@@ -227,7 +227,9 @@
$(document).ready(function() {
var inp = $('#query').first()
var val = inp.val()
- inp.val('').blur().focus().val(val)
+ if (val.length) {
+ inp.val('').blur().focus().val(val)
+ }
});
});