you forgot to protect cout by mutex