Added cache locking