possible race condition fix