improve lastindex logic for lists with 1 msg