       onDisplay(-> $(document).trigger('modal:page'))
 
       form = $("form[data-path='#{path}']")[0] # only take the first form matching the path
-      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]')
+
+      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.length > 0
+      modalOptions = if steps? and steps.length > 0
 
         views = {}
         $(steps).each (i, el) ->

      modalView = new Modal()

      # bind submit events because this is a remote form
      if $(form).attr('data-remote')

        $(form).bind 'ajax:complete', ->
          $('.bbm-modal').empty() # so that pages are re-rendered

            return false # to block disappearance

          onRender: ->
            if form
              $(this.el).modal('replaceSubmit')
            else
              $(this.el).find(".submit").hide()
              $(this.el).find(".close").addClass('alone')

          beforeCancel: -> !@submitting
        }
