detection of encoding
extraction of the shared tags
fix possible race condition