Fixed event for adding as last tab and removed unneeded parameter for template name