Fixed a memory leak by not closing the window in moving the active window forwards and backwards
Updated the patch with memory leak fix