fixed menuLastItem, removed unused code