fix authentication check