what about setting `$scope.failed` here and avoid this `finally` part?