manage connect/disconnect with persistent mutable map