Changes some bugs with redirect to login when status 401