fix period wrapping on schedule