externalized search query + bugfixes