python check if next element in list exists