Potential fix to race condition