fixed another race condition