Fixed race condition (not really)