changed the Thread safe