diff --git a/require-ess/tools/setE3Env.bash b/require-ess/tools/setE3Env.bash
index 0a8344472c70227bfbc716ab5acbc4e414511ca5..dea3f30df14af1863eff6d93cfb05610aad8a4af 100644
--- a/require-ess/tools/setE3Env.bash
+++ b/require-ess/tools/setE3Env.bash
@@ -29,6 +29,7 @@
 # the ROOT build system in ${ROOTSYS}/bin/, and modified
 # a little to return its result
 # Wednesday, July 11 23:19:00 CEST 2018, jhlee
+
 drop_from_path() {
   #
   # Assert that we got enough arguments
@@ -157,9 +158,8 @@ if [ -n "$EPICS_BASE" ]; then
 
     fi
 
-    e3_ld_path=${LD_LIBRARY_PATH}
-    drop_e3_ld_path="${E3_REQUIRE_LIB}/${EPICS_HOST_ARCH}"
-    LD_LIBRARY_PATH=$(drop_from_path "${e3_ld_path}" "${drop_e3_ld_path}")
+    # Drop the require-related LD_LIBRARY pathes  set previously
+    LD_LIBRARY_PATH=$(drop_from_path "$LD_LIBRARY_PATH" "${E3_REQUIRE_LOCATION}[^:]*")
     export LD_LIBRARY_PATH
 
     unset E3_REQUIRE_NAME
@@ -327,8 +327,8 @@ export PATH
 
 old_ld_path=${LD_LIBRARY_PATH}
 E3_LD_LIBRARY_PATH="${EPICS_BASE}/lib/${EPICS_HOST_ARCH}:${E3_REQUIRE_LIB}/${EPICS_HOST_ARCH}"
-
 LD_LIBRARY_PATH=$(set_variable "${old_ld_path}" "${E3_LD_LIBRARY_PATH}")
+
 export LD_LIBRARY_PATH
 
 # Add iocsh.bash autocompletion