Solve loading race condition