FIX 'msg' grom global to local variable to avoid race conditions in notification sending threads