added type and hidden fields to attachments