Updated get_next_item