Fix race condition with parsing values