debug log
race condition fix