added addAttribute to filter out empty string