scope seems an odd name for this variable, especially given its meaning w.r.t. variable names and line #12 above.  Why not debugWindow or targetWindow.?