fixing error of throwing AuthError