use correct attribute to detect window size