Fix authentication check