Check if window width exists before saving var