modified code to redirect user to the login screen on 401