Fix concurency issues