       course = User.getCourse(@props.collectionUUID)
 
       if view is 'task'
-        coach = <Task {...@props} key='task'/>
+        <Task {...@props} key='task'/>
       else if view is 'dashboard'
-        coach = <Dashboard id={course.id}/>
+        <Dashboard id={course.id}/>
       else if view is 'profile'
-        coach = <CourseRegistration {...@props} onComplete={@updateUser} />
+        <UserProfile onComplete={@showTasks} />
+      else
+        <h3 className="error">bad internal state, no view is set</h3>
 
   render: ->
     {isLoaded, isLoggedIn} = @state


{Task} = require '../task'
{Navigation} = require './navigation'
UserLoginButton = require '../user/login-button'
UserLogin = require '../user/login'

{ExerciseStep} = require '../exercise'
{Dashboard} = require '../dashboard'

CourseRegistration = require '../course/registration'
User = require '../user/model'

{channel} = require './model'

    {view} = eventData
    @setState({view}) if view?

  showTasks: ->
    @updateView(view: 'task')

  getUserState: ->
    course = User.getCourse(@props.collectionUUID)

