resolved potential issues with access to shared mutable state