fix: when last element is optgroup