prevent race condition on msg.Attempts