diff --git a/search/ajax/search.php b/search/ajax/search.php
index 5bd810aacfd92cf49483354677fda04f62402bd7..2bafe65302b412bd99a6406ecbb60851cde8ec5f 100644
--- a/search/ajax/search.php
+++ b/search/ajax/search.php
@@ -22,7 +22,8 @@
 */
 
 // Check if we are a user
-\OC_JSON::checkLoggedIn();
+\OCP\JSON::checkLoggedIn();
+\OCP\JSON::callCheck();
 \OC::$server->getSession()->close();
 
 if (isset($_GET['query'])) {