Debugging race condition