re-add locking on metadata file