SPC-809, add check if window is attached