add reader writer lock