Prevent a possible race condition