Fix authentication bug