made sure window duration is not too small