Removes race condition introduced while trying to fix #1275.
Created by: dsparacio
Third iteration of this fix. This time I hope there are no more edge cases. Race condition was introduced with last solution.
Created by: dsparacio
Third iteration of this fix. This time I hope there are no more edge cases. Race condition was introduced with last solution.