Fix misusage of Thread storage