call $item->attr() instead of $item->attr