Fix data race warning