Fix concurrency issue. Amendment of last commit.