fix possible access beyond registered upper layer threads