removed double lock in logStreamError catcher
added new keyExists check to avoid created unecessary undefined keys
shifted from raw ptrs to shared_ptrs