Add lock for network access