use TimeFrame property instead of calculating Period manually