change from addAttribute to addAttributes