revised NULL check for search, function checks body class instead