diff --git a/core/trunk/ws_server.php b/core/trunk/ws_server.php
index 7162f8c44cc2478a94dd9c452da71af10e0c9db6..76dc1db2bdd4c7f6ccb07554c202d2419a0a4b57 100755
--- a/core/trunk/ws_server.php
+++ b/core/trunk/ws_server.php
@@ -43,6 +43,25 @@ $portal->unset_session();
 $portal->build_config();
 $coreTools = new core_tools();
 $_SESSION["custom_override_id"] = $coreTools->get_custom_id();
+if (isset($_SESSION['custom_override_id'])
+    && ! empty($_SESSION['custom_override_id'])
+    && isset($_SESSION['config']['corepath'])
+    && ! empty($_SESSION['config']['corepath'])
+) {
+    $path = $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
+        . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR;
+    //echo $path;
+    set_include_path(
+        $path . PATH_SEPARATOR . $_SESSION['config']['corepath']
+        . PATH_SEPARATOR . get_include_path()
+    );
+} else if (isset($_SESSION['config']['corepath'])
+	&& ! empty($_SESSION['config']['corepath'])
+) {
+    set_include_path(
+        $_SESSION['config']['corepath'] . PATH_SEPARATOR . get_include_path()
+    );
+}
 $coreTools->build_core_config("core".DIRECTORY_SEPARATOR."xml".DIRECTORY_SEPARATOR."config.xml");
 $_SESSION["config"]["app_id"] = $_SESSION["businessapps"][0]["appid"];
 require_once("apps".DIRECTORY_SEPARATOR.$_SESSION["businessapps"][0]["appid"].DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_business_app_tools.php");