fixed throwing 401 and 404