fixing some concurrent issues