Fixed crash caused by a race condition