 
   removePrototype: (removeButton) ->
     removeButton.parent().remove()
+    @index--
     @toogleAddButton()
     return

  required = @required
  @collectionHolder.children().each (index) ->
    prototype = $(this)
    if !required || index > 0
      prototype = self.createRemoveButton($(this))
    if prototype.find(".alert-error").length is 0
      prototype.addClass("old").removeClass("new")
    else


PO.formPrototype:: =
  toogleAddButton: ->
    if @limit is `undefined` or @index < @limit
      @createAddButton()
    else
      @removeAddButton()
    if @index < 2 && @required
      @collectionHolder.children().children("button.prototype-remove").hide()
    else
      @collectionHolder.children().children("button.prototype-remove").show()
    return

  createAddButton: ->
