Added mutex/lock_guard to listener