 
     #Invoked automatically by ember when the view is destroyed, giving us a chance to perform cleanups
     willDestroyElement: ->
+        Em.$('body').removeClass('modal-open')
         @removeHandlers()
         name = @get('name')
         name?= @get('elementId')

Ember.Application.initializer
    name: 'bs-modal'
    initialize: (container, application) ->
        container.register 'component:bs-modal', Bootstrap.BsModalComponent
            @show()

    becameVisible: ->
        Em.$('body').addClass('modal-open')
        @appendBackdrop() if @get("backdrop")

    becameHidden: ->
        Em.$('body').removeClass('modal-open')
        @_backdrop.remove() if @_backdrop

    appendBackdrop: ->
