Fix authentication failed bug