being conservative with buffer size in the case of small window