added shared locking