fix split window function