handling 401 auth errors