added attach to window