Added check for number of dates