Use rwmutex to make goroutine safe