Moved cache lock just after lock check
Fixed timeout error
Merge branch 'latest_changes'