fix ancient thread-unsafe bug...