ThreadSafe + bug fix