update window length