- added a lock to cache query