Fixed possible non thread safe section.