     unless @state.invalid
       CourseActions.save(@props.courseId, course: {name: @state.course_name})
       CourseStore.once 'saved', ->
-        @refs.overlay.hide()
+        @close()
 
   renderForm: ->
     formClasses = classnames 'modal-body', 'teacher-edit-course-form', 'is-invalid-form': @state?.invalid


  getInitialState: ->
    course_name: @props.course.name

  validate: (name) ->
    error = CourseStore.validateCourseName(name, @props.course.name)

    </BS.Modal>

  render: ->
    <span>
      <BS.Button onClick={@open} bsStyle='link' className='edit-course'>
        <i className='fa fa-pencil' /> Rename Course
      </BS.Button>
      {@renderForm()}
    </span>

module.exports = RenameCourse
