added read write lock