       modalView = new Modal()
 
       # bind submit events because this is a remote form
-      if $(form).attr('data-remote')
+      if form? and $(form).attr('data-remote')
 
         $(form).bind 'ajax:complete', ->
           $('.bbm-modal').empty() # so that pages are re-rendered

            return false # to block disappearance

          onRender: ->
            $(this.el).modal('replaceSubmit')

          beforeCancel: -> !@submitting
        }

      onDisplay(-> $(document).trigger('modal:page'))

      form = $("form[data-path='#{path}']")[0] # only take the first form matching the path

      if form?
        form = $([form]) # wrap form again so that we can call .submit() for jquery-ujs and other jquery event listeners on 'submit'

        steps = $(form).find('*[data-modal-step]')
      
      modal = $("script[type='text/template'][data-path='#{path}']")

      modalOptions = if steps? and steps.length > 0

        views = {}
        $(steps).each (i, el) ->
