adding caching for visibility/write check