Fixed a subtle race condition