last period of year bug fixed