       disableUIStyles: true,
       inDuration: 0,
       linkClass: "_ht_link",
-      remoteAjax: this.createAjaxEvents(), # adds first Ajax event
+      remoteAjax: this.ajaxEvents(true), # adds first Ajax event
       formOptions:
         success: (data) =>
           console.log "Successful form POST"

  bindEvents: ->
    @form.bind "step_shown", (event, data) =>
      this.setCurrentStepField()
      this.setFormFields(ht.formModel)

      if data.previousStep is data.firstStep
        console.log "Adding additional Ajax events"
        # adds additional Ajax events now that we have the update URL
        @form.formwizard("option", remoteAjax: this.createAjaxEvents(false))

    @form.bind "after_remote_ajax", (event, data) =>
      if ht.wizardMetadata.currentStep.repeatOf?
        this.repeatStep(ht.wizardMetadata.currentStep)
      else
        this.showStep(ht.wizardMetadata.currentStep)

$ ->
  $form = $("form.wizard")
  if ht? and !htWizard?
    console.log "Creating new HatTrickWizard instance"
    window.htWizard = new HatTrickWizard($form, ht.wizardMetadata)

class HatTrickWizard
  constructor: (formElem, @wizard) ->
    @form = $(formElem)
    fieldsets = @form.find("fieldset")
    fieldsets.addClass("step")
    wizard_buttons = '<input type="reset" /><input type="submit" />'
    fieldsets.find("div.buttons").html wizard_buttons
    this.enableFormwizard() # unless this.formwizardEnabled()
    this.setCurrentStepField()
    # TODO: Try this out instead of putting :start first
