var removeCustomUnit = function() {
        var index = $(this).data("customunitindex");
        if (typeof index !== "undefined") {
            $('.js-custom-unit-' + index).remove();
        }