use ReadWriteLock instead of Mutex