fix a bug that index error was raised when csv file contains only one year
successfully applying json and ajax