your forgot to protect cout by mutex