added proper window attribute handling