LPS-51428 Fix race condition