Fix Thread-Safe issue