[BUGFIX] If there's only one page in menu also add the lastClass to the item

if length is one, the case to add the last would not be reached, because of the first break