Adde new feature to select the period.