change to using a read-only lock