[QE-1108] Fixing race condition