fix for rare concurrentmodificationexception + fixed memleak in interfacemanager