figure out the read and write lock ,to be verified