added window listener support