diff --git a/src/main/java/net/floodlightcontroller/simpleft/FT.java b/src/main/java/net/floodlightcontroller/simpleft/FT.java
index f9b74a10342a0d757a7e48c54567180276e09591..68ed31e798b39545120c07ee8a408537bcdc5601 100644
--- a/src/main/java/net/floodlightcontroller/simpleft/FT.java
+++ b/src/main/java/net/floodlightcontroller/simpleft/FT.java
@@ -106,8 +106,6 @@ IRPCListener
 
 		Map<String, String> configParams = context.getConfigParams(FloodlightProvider.class);
 		controllerId = configParams.get("controllerId");
-		
-			
 	}
 
 	@Override
@@ -181,8 +179,10 @@ IRPCListener
 	@Override
 	public void switchActivated(DatapathId switchId) {
 		// TODO Auto-generated method stub
+		String switches = getActiveSwitches();
+		if(switches==null)return;
 		try {
-			this.storeFT.put(controllerId, getActiveSwitches());
+			this.storeFT.put(controllerId, switches);
 		} catch (SyncException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();