Adds authentication check