diff --git a/cps/templates/layout.html b/cps/templates/layout.html
index 4e529eea..66fffda4 100644
--- a/cps/templates/layout.html
+++ b/cps/templates/layout.html
@@ -228,7 +228,7 @@
$(document).ready(function() {
var inp = $('#query').first()
var val = inp.val()
- if (val.length) {
+ if (val !== "undefined") {
inp.val('').blur().focus().val(val)
}
});