corrected window size (still bug when read is shorter than window size)