fixed issues with sliding window