fixed issue where template update would fail if attachment was added and then removed from form