     @loadSolution = => #load the solution and pdf for the current exercise
       if !@exercise()
         @pages []
-        return
+        return Q.reject()
 
       getSolution = api.get.nextSolution @exercise().id
         .then (solution) => @solution solution

      .then (exercise) =>
        @exercise exercise
        @loadSolution()
      .catch (e) -> 
        console.error(e)
        alert 'Could not load this solution.'
    else if @params.solutionId

    @loadExercise = => #load the exercise and pdf for the current solution
      if !@solution()
        @pages []
        return Q.reject()

      getExercise = api.get.exercise @solution().exercise
        .then (exercise) => @exercise exercise

      getExercise.then(=> @loadPdf()).then => @initPages()

    @initPages = =>
      result = @solution().result
