add read writer lock for range