Added the functionality to close object tool window on close of frame