run-before fix: 'period_sec' variable is set from 'period'