use correct attributes to detect window width