diff --git a/src/main/java/org/olat/ldap/LDAPLoginModule.java b/src/main/java/org/olat/ldap/LDAPLoginModule.java
index 59d1549ab206eb081113f767e80c7aa9d3bd4625..90c1b4f8b172eed4ffa9ea713f75f6670905cc5c 100644
--- a/src/main/java/org/olat/ldap/LDAPLoginModule.java
+++ b/src/main/java/org/olat/ldap/LDAPLoginModule.java
@@ -149,8 +149,6 @@ public class LDAPLoginModule extends AbstractSpringModule {
 	private Scheduler scheduler;
 	@Autowired
 	private BaseSecurity securityManager;
-	@Autowired
-	private LDAPLoginManager ldapManager;
 	
 	@Autowired
 	public LDAPLoginModule(CoordinatorManager coordinatorManager) {
@@ -240,22 +238,6 @@ public class LDAPLoginModule extends AbstractSpringModule {
 				log.warn("Server Certificate will expire in less than 30 days.");
 			}
 		}
-		
-		// Check ldap connection
-		if (ldapManager.bindSystem() == null) {
-			// don't disable ldap, maybe just a temporary problem, but still report
-			// problem in logfile
-			log.error("LDAP connection test failed during module initialization, edit config or contact network administrator");
-		} else {
-			log.info("LDAP login is enabled");
-		}
-		
-		// Sync LDAP Users on Startup
-		if (isLdapSyncOnStartup()) {
-			initStartSyncJob();
-		} else {
-			log.info("LDAP start sync is disabled");
-		}
 
 		// Start LDAP cron sync job
 		if (isLdapSyncCronSync()) {
@@ -273,19 +255,6 @@ public class LDAPLoginModule extends AbstractSpringModule {
 		//
 	}
 
-	/**
-	 * Internal helper to sync users right away
-	 * @param ldapManager
-	 */
-	private void initStartSyncJob() {
-		LDAPError errors = new LDAPError();
-		if (ldapManager.doBatchSync(errors, true)) {
-			log.info("LDAP start sync: users synced");
-		} else {
-			log.warn("LDAP start sync error: " + errors.get());
-		}
-	}
-
 	/**
 	 * Internal helper to initialize the cron syncer job
 	 */
diff --git a/src/main/java/org/olat/ldap/manager/LDAPLoginManagerImpl.java b/src/main/java/org/olat/ldap/manager/LDAPLoginManagerImpl.java
index 0c934d5204be118f98afd6d80ad35b64dc627e61..237a9c8306de88e9ddd17667adcb8f1099c11c5e 100644
--- a/src/main/java/org/olat/ldap/manager/LDAPLoginManagerImpl.java
+++ b/src/main/java/org/olat/ldap/manager/LDAPLoginManagerImpl.java
@@ -65,6 +65,8 @@ import org.olat.core.util.StringHelper;
 import org.olat.core.util.WorkThreadInformations;
 import org.olat.core.util.coordinate.Coordinator;
 import org.olat.core.util.coordinate.CoordinatorManager;
+import org.olat.core.util.event.FrameworkStartedEvent;
+import org.olat.core.util.event.FrameworkStartupEventChannel;
 import org.olat.core.util.event.GenericEventListener;
 import org.olat.core.util.mail.MailHelper;
 import org.olat.group.BusinessGroup;
@@ -130,6 +132,7 @@ public class LDAPLoginManagerImpl implements LDAPLoginManager, GenericEventListe
 		this.coordinator = coordinatorManager.getCoordinator();
 		this.taskExecutorManager = taskExecutorManager;
 		coordinator.getEventBus().registerFor(this, null, ldapSyncLockOres);
+		FrameworkStartupEventChannel.registerForStartupEvent(this);
 	}
 
 	@Override
@@ -145,6 +148,36 @@ public class LDAPLoginManagerImpl implements LDAPLoginManager, GenericEventListe
 			} else if(LDAPEvent.DO_FULL_SYNCHING.equals(event.getCommand())) {
 				doHandleBatchSync(true);
 			}
+		} else if(event instanceof FrameworkStartedEvent) {
+			try {
+				init();
+			} catch (Exception e) {
+				log.error("", e);
+			}
+		}
+	}
+	
+	private void init() {
+		if(ldapLoginModule.isLDAPEnabled()) {
+			if (bindSystem() == null) {
+				// don't disable ldap, maybe just a temporary problem, but still report
+				// problem in logfile
+				log.error("LDAP connection test failed during module initialization, edit config or contact network administrator");
+			} else {
+				log.info("LDAP login is enabled");
+			}
+			
+			// Start LDAP cron sync job
+			if (ldapLoginModule.isLdapSyncCronSync()) {
+				LDAPError errors = new LDAPError();
+				if (doBatchSync(errors, true)) {
+					log.info("LDAP start sync: users synced");
+				} else {
+					log.warn("LDAP start sync error: " + errors.get());
+				}
+			} else {
+				log.info("LDAP cron sync is disabled");
+			}
 		}
 	}
 	
diff --git a/src/main/java/org/olat/ldap/ui/LDAPAdminController.java b/src/main/java/org/olat/ldap/ui/LDAPAdminController.java
index c23832276cd123d6c90db577a085925bd53bd95b..1237a8f11826f615713cda658ff3cbd1f75334d3 100644
--- a/src/main/java/org/olat/ldap/ui/LDAPAdminController.java
+++ b/src/main/java/org/olat/ldap/ui/LDAPAdminController.java
@@ -197,19 +197,19 @@ public class LDAPAdminController extends BasicController implements GenericEvent
 					 * wizard finish callback called after "finish" is called
 					 */
 					StepRunnerCallback finishCallback = new StepRunnerCallback() {
-						public Step execute(UserRequest ureq, WindowControl control, StepsRunContext runContext) {
+						public Step execute(UserRequest uureq, WindowControl control, StepsRunContext runContext) {
 							hasIdentitiesToDeleteAfterRun = ((Boolean) runContext.get("hasIdentitiesToDelete")).booleanValue();
 							if (hasIdentitiesToDeleteAfterRun) {
-								List<Identity> identitiesToDelete = (List<Identity>) runContext.get("identitiesToDelete");
-								amountUsersToDelete = identitiesToDelete.size();
+								List<Identity> idToDelete = (List<Identity>) runContext.get("identitiesToDelete");
+								amountUsersToDelete = idToDelete.size();
 								// Delete all identities now and tell everybody that
 								// we are finished
-								ldapLoginManager.deletIdentities(identitiesToDelete);
+								ldapLoginManager.deletIdentities(idToDelete);
 								return StepsMainRunController.DONE_MODIFIED;
 							} else {
 								return StepsMainRunController.DONE_UNCHANGED;
 							}
-							// otherwhise return without deleting anything
+							// otherwise return without deleting anything
 						}
 
 					};